<?php 
$DEVELOPMENT=1;
$LOG_FILE = '/tmp/primaKlima.log';

// DEVELOPMENT
if ($DEVELOPMENT == 1) {
	$LOG_FILE = 'primaKlima.log';
}

$tempActualLightSystem2 = $_REQUEST['actualLightSystem2'];
$tempGivenLightSystem2 = $_REQUEST['givenLightSystem2'];
$tempTemp = $_REQUEST['tempSystem2'];
$tempTime = $_REQUEST['time'];

$tempFile = fopen ( $LOG_FILE, "a" ) or die ( "Unable to open log file!" );
$tempLogMessage = date("H:i:s").','.$tempTime.','.$tempActualLightSystem2.','.$tempGivenLightSystem2.','.$tempTemp."\n";
fwrite ( $tempFile, $tempLogMessage);
fclose ( $tempFile );
?>